package com.wyx.suanfa;

import javax.swing.tree.TreeNode;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class lowestCommonAncestor2 {
    //给定一个二叉搜索树, 找到该树中两个指定节点的最近公共祖先。
    public static void main(String[] args) {

    }
}
/*
*
class Solution {
    public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
        if(root.val > p.val && root.val > q.val){
            return lowestCommonAncestor(root.left,p,q);
        }else if(root.val < p.val && root.val < q.val){
            return lowestCommonAncestor(root.right,p,q);
        }else{
            return root;
        }
    }
}*/
